/**
 * Invoker.java
 */
package com;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 *
 */
public class Invoker {

	List<Command> commandList = new ArrayList<Command>();
	/**
	 * 
	 */
	public Invoker() {
		// Do something for the invoke
	}
	
	public void storeAndExecute(Command command){
		//Store the command which will be executed.
		this.commandList.add(command);
		//command is interface Command type's variable.
		// it can be turn off/turn on  concrete class.
		//it will according to concrete class object and invoke different method.
		command.execute();
	}
	
	
}
